<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>艾家艾产品线上销售平台</title>
    <link rel="shortcut icon" href="../img/favicon.ico">
    <link rel="stylesheet" href="../css/reset.css"/>
    <link rel="stylesheet" href="../css/register.css"/>
    <script src="../them/jquery/jquery-1.7.2.js"></script>
    <script src="../them/jquery/jquery.cookie.js"></script>
</head>
<body>
<div class="box">
    <div class="header">
        <div class="header-logo">
            <div class="logo_b"></div>
            <div class="tittle">
                <p style="font-size: 32px;margin-bottom: 25px">注册艾家账号</p>
            </div>
        </div>
    </div>
    <div class="regbox">
        <form method="post" >
            <input type="text" name="use" placeholder="请输入手机号" style="width: 334px;" id="phone">
            <p class="hint phone-text"></p>
            <div class="verify">
                <input type="password" name="pass" placeholder="图片验证码" style="width: 197px;" id="verify">
                <span class="verify-img">再次获取验证码</span>
                <p class="hint verify-text"></p>
            </div>
        </form>
        <a class="btn" href="javascript:;">立即注册</a>
        <p class="look">点击“立即注册”，即表示您同意并愿意遵守艾家 用户协议 和 隐私政策</p>
    </div>
</div>

<div class="footer">
    <div class="footer-are">
        <a href="javascript:;">简体</a>
        <span> | </span>
        <a href="javascript:;">繁体</a>
        <span> | </span>
        <a href="javascript:;">English</a>
        <span> | </span>
        <a href="javascript:;">常见问题</a>
    </div>
    <div class="footer-info">
        <p>艾家艾草公司版权所有-京ICP备10046444-京公网安备11010802020134号-京ICP证110507号</p>
    </div>
</div>
</body>
</html>
<script>
    $('#phone').focus();
    function verification(){
        $('#phone').blur(function(){
            if($(this).val()==''){
                $('.phone-text').css('display','block');
                $('.phone-text').html('手机号不能为空');
                return false;
            }
            var reg=/^1\d{10}$/;
            if(!reg.test($(this).val())){
                $('.phone-text').css('display','block');
                $('.phone-text').html('请输入正确的手机号');
                return false;
            }
            $('.phone-text').css('display','none');
        });
        $('#verify').blur(function(){
            if($(this).val()==''){
                $('.verify-text').css('display','block');
                $('.verify-text').html('图片验证码不能为空');
                return false;
            }
            if($(this).val().length<4){
                $('.verify-text').css('display','block');
                $('.verify-text').html('图片验证码错误');
                return false;
            }
            $('.verify-text').css('display','none');
        });
    }
    verification();

    $('.btn').click(function(){
        if($('.verify-text').is(":hidden")&&$('.phone-text').is(":hidden")){
            var user_phone=$('#phone').val();
            var cookietime = new Date();
            var date = new Date();
            cookietime.setTime(date.getTime() + (5 * 60 * 1000));//coockie保存5分钟
            $.cookie("user_phone", user_phone,{expires:cookietime});
            $('.btn').attr('href','register-password.html');
        }else{
            return false;
        }
    });

</script>